import { defineStore } from 'pinia'
import { ref } from 'vue'


export const useUserStore = defineStore('jixiang-supply-chain-admin-user', () => {
  const userInfo = ref({})

  const getUserInfo = () => {
    return userInfo.value
  }

  const setUserInfo = (userdata) => {
    userInfo.value = userdata
  }

  const getUserInfoByPassword = async (form) => {
    console.log(form)
  }

  const getUserInfoByPhone = async (form) => {
    console.log(form)
  }

  const clearUserInfo = () => {
    userInfo.value = {}
  }

  return {
    userInfo,
    getUserInfoByPassword,
    getUserInfoByPhone,
    clearUserInfo,
    setUserInfo,
    getUserInfo
  }
},
  {
    persist: true,
  }
)
